﻿namespace NET6.WebAPI.Reqs.Tool
{
    /// <summary>
    /// 分页请求模型
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class PagingReq<T> where T : class
    {
        private int _pageNumber;

        private int _pageSize;

        /// <summary>
        /// 页数
        /// </summary>
        public int PageNumber
        {
            get => _pageNumber;
            set => _pageNumber = value <= 0 ? 1 : value;
        }

        /// <summary>
        /// 页行数
        /// </summary>
        public int PageSize
        {
            get => _pageSize;
            set => _pageSize = value <= 0 ? 20 : value;
        }

        /// <summary>
        /// 请求主体
        /// </summary>
        public T Body { get; set; }
    }
}
